<?php
#### START AUTOCODE
################################################################################
#  Lumine - Database Mapping for PHP
#  Copyright (C) 2005  Hugo Ferreira da Silva
#  
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>
################################################################################
/**
 * Classe generada para a tabela "fornecedor"
 * in 2014-02-24
 * @author Hugo Ferreira da Silva
 * @link http://www.hufersil.com.br/lumine
 * @package dao_orm
 *
 */

class Fornecedor extends Lumine_Base {

    // sobrecarga
    protected $_tablename = 'fornecedor';
    protected $_package   = 'dao_orm';
    
    
    public $codigoFornecedor;
    public $nome;
    public $cnpj;
    public $telefone;
    public $nomeFantasia;
    public $telefone2;
    public $rua;
    public $numero;
    public $bairro;
    public $cidade;
    public $pais;
    public $conta;
    public $cep;
    public $produtos = array();
    
    
    
    /**
     * Inicia os valores da classe
     * @author Hugo Ferreira da Silva
     * @return void
     */
    protected function _initialize()
    {
        
        
        # nome_do_membro, nome_da_coluna, tipo, comprimento, opcoes
        
        $this->_addField('codigoFornecedor', 'CODIGO_FORNECEDOR', 'int', 11, array('primary' => true, 'notnull' => true, 'autoincrement' => true));
        $this->_addField('nome', 'NOME', 'varchar', 200, array('notnull' => true));
        $this->_addField('cnpj', 'CNPJ', 'varchar', 20, array());
        $this->_addField('telefone', 'TELEFONE', 'varchar', 15, array());
        $this->_addField('nomeFantasia', 'NOME_FANTASIA', 'varchar', 200, array());
        $this->_addField('telefone2', 'TELEFONE2', 'varchar', 15, array());
        $this->_addField('rua', 'RUA', 'varchar', 200, array());
        $this->_addField('numero', 'NUMERO', 'varchar', 200, array());
        $this->_addField('bairro', 'BAIRRO', 'varchar', 200, array());
        $this->_addField('cidade', 'CIDADE', 'varchar', 200, array());
        $this->_addField('pais', 'PAIS', 'varchar', 200, array());
        $this->_addField('conta', 'CONTA', 'varchar', 50, array());
        $this->_addField('cep', 'CEP', 'varchar', 10, array());

        
        $this->_addForeignRelation('produtos', self::ONE_TO_MANY, 'Produtos', 'codigoFornecedor', null, null, null);
    }

    /**
     * Recupera um objeto estaticamente
     * @author Hugo Ferreira da Silva
     * @return Fornecedor
     */
    public static function staticGet($pk, $pkValue = null)
    {
        $obj = new Fornecedor;
        $obj->get($pk, $pkValue);
        return $obj;
    }

	/**
	 * chama o destrutor pai
	 *
	 */
	function __destruct()
	{
		parent::__destruct();
	}
	
    #------------------------------------------------------#
    # Coloque todos os metodos personalizados abaixo de    #
    # END AUTOCODE                                         #
    #------------------------------------------------------#
    #### END AUTOCODE


}
